
package com.uuah.server.api;

import com.uuah.exception.AbstractUuahException;
import com.uuah.server.api.component.service.IService;
import com.uuah.server.api.endpoint.IEndpointURI;
import com.uuah.server.api.endpoint.IUuahEndpoint;
import com.uuah.server.api.session.IUuahSession;
import com.uuah.server.exception.AbstractUuahServerException;
import com.uuah.server.exception.transformer.TransformerException;


public interface IUuahEventContext {
	IUuahMessage getMessage();

	byte[] getMessageAsBytes() throws AbstractUuahException;

	Object transformMessage() throws TransformerException;

	Object transformMessage(Class expectedType) throws TransformerException;

	byte[] transformMessageToBytes() throws TransformerException;

	String transformMessageToString() throws TransformerException;

	String getMessageAsString() throws AbstractUuahException;

	String getMessageAsString(String encoding) throws AbstractUuahException;

	IUuahMessage sendEvent(Object message) throws AbstractUuahServerException;

	IUuahMessage sendEvent(IUuahMessage message)
			throws AbstractUuahServerException;

	void dispatchEvent(IUuahMessage message) throws AbstractUuahServerException;

	void dispatchEvent(Object payload) throws AbstractUuahServerException;

	void dispatchEvent(IUuahMessage message, IEndpointURI endpoint)
			throws AbstractUuahServerException;

	void dispatchEvent(IUuahMessage message, String endpointName)
			throws AbstractUuahServerException;

	void dispatchEvent(IUuahMessage message, IUuahEndpoint endpoint)
			throws AbstractUuahServerException;

	IService getService();

	boolean isSynchronous();

	IEndpointURI getEndpointURI();

	int getTimeout();

	String getEncoding();

	IUuahSession getSession();

	IUuahContext getUuahContext();
}
